package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.DestinationSearch;
import cn.wolfcode.luowowo.article.mapper.DestinationSearchMapper;
import cn.wolfcode.luowowo.article.service.IDestinationSearchService;
import cn.wolfcode.luowowo.common.query.DestinationSearchQueryObject;
import cn.wolfcode.luowowo.common.query.QueryObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class DestinationSearchServiceImpl implements IDestinationSearchService {

    @Autowired
    private DestinationSearchMapper destinationSearchMapper;

    @Override
    public PageInfo<DestinationSearch> query(DestinationSearchQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        List<DestinationSearch> list = destinationSearchMapper.query(qo);
        return new PageInfo<>(list);
    }
}
